#include<iostream>

using namespace std;
int n, m, t;
int x, y, x1, y1;
const int N = 10;
bool e[N][N];
bool st[N][N];
int ret;
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

void dfs(int u, int v)
{
    
    if (u == x1 && v == y1)
    {
        ret++;
        return ;
    }
    st[u][v] = true;
    for (int k = 0; k < 4; k++)
    {
        int x = u + dx[k], y = v + dy[k];
        if (x < 1 || x > n || y < 1 || y > m || e[x][y] || st[x][y]) continue;
        dfs(x, y);
    }
    st[u][v] = false;
}
int main()
{
    // zdl:: 这其实就是一道简单的dfs)

    cin >> n >> m >> t;
    cin >> x >> y >> x1 >> y1;
    for (int i = 1; i <= t; i++)
    {
        int a, b;
        cin >> a >> b;
        // 用于标记障碍物
        e[a][b] = true;

    }
    dfs(x, y);
    cout << ret << endl;
    return 0;
}